from twilio.rest import Client
SMS_ACCOUNT="/home/pi/remind/SMS_ACCOUNT.txt"

'''SMS模块配置'''
class MYSMS():
	def __init__(self):
		usrfile=open(SMS_ACCOUNT,'r')
		usr_info=usrfile.readlines()
		self.accountSID=usr_info[1].split('=')[1].strip()
		self.authToken = usr_info[2].split('=')[1].strip()
		self.myTwilioNumber=usr_info[3].split('=')[1].strip()
		self.myCellPhone=usr_info[4].split('=')[1].strip()
		self.twilioCli=Client(self.accountSID,self.authToken)
		self.message='null'
		usrfile.close()
	def SendToMe(self,txt):
		self.message=self.twilioCli.messages.create(body=txt,from_=self.myTwilioNumber,to=self.myCellPhone)
		print(self.message.sid)
